﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;

namespace BBInterfaceNET.ProjectExplorer.Converters
{
    public class FileTypeToImageConverter:IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            string str = (string)value;
            if (str == null) return null;

            if (str.ToLower().EndsWith("bbfx"))
                return new Uri("/BBInterfaceNET.ProjectExplorer;component/Resources/ttFile.png", UriKind.Relative);
            else
                return new Uri("/BBInterfaceNET.ProjectExplorer;component/Resources/imageIcon.png", UriKind.Relative);
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
